package com.young.domain;

/**
 * @description：任务执行结果枚举
 * @author: yangyahui01
 * @date: 11/25/24 3:00 PM
 */
public enum  JobExecuteResultEnum {

    CLIENT_ERROR(-1,"客户端执行错误"),
    SUCCESS(0,"执行成功"),
    CLIENT_NOT_EXIST(1,"客户端任务类或者方法不存在");
    private int status;
    private String response;

    JobExecuteResultEnum(int status,String response) {
        this.status = status;
        this.response = response;
    }

    public int getStatus() {
        return status;
    }

    public String getResponse() {
        return response;
    }

    public static JobExecuteResultEnum valueOf(int status) {

        for (JobExecuteResultEnum e : JobExecuteResultEnum.values()) {
            if (e.getStatus() == status) {
                return e;
            }
        }

        return null;
    }
}
